<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

class CategoryValidate extends CoreValidate {
	
	//constructor
	function CategoryValidate() {
		
	}
	
	//methods
	function check($data_array) {
		//name
		if( $this->_str_eq($data_array['field_name'], 0) ) {
			$this->_add('field_name', 'The Name is Null');
		} elseif( $this->_str_lt($data_array['field_name'], 2) ) {
			$this->_add('field_name', 'The Name is less than 2 characters');
		} elseif( $this->_str_gt($data_array['field_name'], 100) ) {
			$this->_add('field_name', 'The Name is more than 100 characters');
		}
	}
}
//
?>